package com.bjpowernode.formatter;
import org.springframework.format.FormatterRegistrar;
import org.springframework.format.FormatterRegistry;

public class MyFormatterRegistrar implements FormatterRegistrar {
    private String datePattern;
    private String errorMsg;
    public MyFormatterRegistrar(String datePattern, String errorMsg) {
        this.datePattern = datePattern;
        this.errorMsg = errorMsg;
    }
    @Override
    public void registerFormatters(FormatterRegistry registry) {
        registry.addFormatter(new MyDateFormatter(datePattern,errorMsg));
    }
}
